package org.dtrd.modules.archive.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.archive.entity.bean.lifeway.*;

import java.util.Date;


/**
 * <p>
 * 生活方式
 * </p>
 *
 * @author QR
 * @since 2021-11-17
 */
@Data
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@TableName("dtrd_ent_rd_archive_lifeway")
public class DtrdEntRdArchiveLifeway {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 患者ID
     */
    @TableField("patient_id")
    private Integer patientId;

    /**
     * 记录日期
     */
    @TableField("record_date")
    private Date recordDate;

    /**
     * 早餐
     */
    @TableField("breakfast")
    private String breakfast;

    /**
     * 早餐进食量
     */
    @TableField("breakfast_intake")
    private String breakfastIntake;

    /**
     * 午餐
     */
    @TableField("lunch")
    private String lunch;

    /**
     * 午餐进食量
     */
    @TableField("lunch_intake")
    private String lunchIntake;

    /**
     * 晚餐
     */
    @TableField("dinner")
    private String dinner;

    /**
     * 晚餐进食量
     */
    @TableField("dinner_intake")
    private String dinnerIntake;

    /**
     * 早餐加餐
     */
    @TableField("extra_breakfast")
    private String extraBreakfast;

    /**
     * 早餐加餐进食量
     */
    @TableField("extra_breakfast_intake")
    private String extraBreakfastIntake;

    /**
     * 午餐加餐
     */
    @TableField("extra_lunch")
    private String extraLunch;

    /**
     * 午餐加餐进食量
     */
    @TableField("extra_lunch_intake")
    private String extraLunchIntake;

    /**
     * 晚餐加餐
     */
    @TableField("extra_dinner")
    private String extraDinner;

    /**
     * 晚餐加餐进食量
     */
    @TableField("extra_dinner_intake")
    private String extraDinnerIntake;

    /**
     * 爱吃及吃得多的食物
     */
    @TableField("like_eat")
    private String likeEat;

    /**
     * 爱喝及喝得多的饮料
     */
    @TableField("like_drink")
    private String likeDrink;

    /**
     * 是否喜欢吃零食
     */
    @TableField("like_snacks")
    private Integer likeSnacks;

    /**
     * 每日坚持吃早餐吗  1 是 2 时吃时不吃 3 经常不吃 4 不吃
     */
    @TableField("still_breakfast")
    private Integer stillBreakfast;

    /**
     * 三餐中哪一餐吃的最多 1 早餐 2 午餐 3 晚餐
     */
    @TableField("which_more")
    private Integer whichMore;

    /**
     * 每顿饭是否吃的很饱 1 非常饱 2 七八分 3 饭后经常有饥饿感
     */
    @TableField("eat_satisfied")
    private Integer eatSatisfied;

    /**
     * 是否喜欢吃宵夜 1 经常 2 偶尔 3 从不
     */
    @TableField("like_midnightfood")
    private Integer likeMidnightfood;

    /**
     * 是否热爱运动 热爱-1，一般-2，不爱动-3
     */
    @TableField("lifeway_sport")
    private Integer lifewaySport;

    /**
     * 运动禁忌症：0-无,1-有,2-不清楚
     */
    @TableField("exercise_taboo")
    private Integer exerciseTaboo;

    /**
     * 运动方式 逗号拼接
     */
    @TableField("exercise_mode")
    private String exerciseMode;

    /**
     * 运动方式其他
     */
    @TableField("exercise_mode_other")
    private String exerciseModeOther;

    /**
     * 运动频率：每周次数
     */
    @TableField("exercise_frequency")
    private Integer exerciseFrequency;

    /**
     * 运动强度 1 强 ，2 中 ，3 低
     */
    @TableField("exercise_duration")
    private Integer exerciseDuration;

    /**
     * 运动时长，单位小时
     */
    @TableField("exercise_duration_hour")
    private String exerciseDurationHour;

    /**
     * 运动时机：1-空腹,2-餐后,3-不固定
     */
    @TableField("exercise_opporunity")
    private Integer exerciseOpporunity;

    /**
     * 喝酒频率: 1-饮酒史,2-每周<=两次,3- 每周>2次
     */
    @TableField("drinking_frequency")
    private Integer drinkingFrequency;

    /**
     * 红酒饮用量
     */
    @TableField("redwine")
    private Float redwine;

    /**
     * 白酒饮用量
     */
    @TableField("whitewine")
    private Float whitewine;

    /**
     * 黄酒饮用量
     */
    @TableField("yellowwine")
    private Float yellowwine;

    /**
     * 啤酒饮用量
     */
    @TableField("beer")
    private Float beer;

    /**
     * 吸烟史 是-1，否-2，已戒烟-3
     */
    @TableField("smoking")
    private Integer smoking;

    /**
     * 吸烟年份
     */
    @TableField("smoking_year")
    private Integer smokingYear;

    /**
     * 吸烟量
     */
    @TableField("smoking_amount")
    private Integer smokingAmount;

    /**
     * 已戒烟年份
     */
    @TableField("un_smoking_year")
    private Integer unSmokingYear;

    /**
     * 睡眠质量
     */
    @TableField("sleep_quality")
    private Integer sleepQuality;

    /**
     * 运动情况是否确认完成, 1-是, 0-否
     */
    @TableField("sport_is_finished")
    private Integer sportIsFinished;

    /**
     * 饮酒情况是否确认完成, 1-是, 0-否
     */
    @TableField("wine_is_finished")
    private Integer wineIsFinished;

    /**
     * 吸烟情况是否确认完成, 1-是, 0-否
     */
    @TableField("smoke_is_finished")
    private Integer smokeIsFinished;

    /**
     * 睡眠情况是否确认完成, 1-是, 0-否
     */
    @TableField("sleep_is_finished")
    private Integer sleepIsFinished;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 您的主食结构是EH8
     */
    @TableField("staple_food_structure")
    private Integer stapleFoodStructure;

    /**
     * 早餐是否吃主食EH9
     */
    @TableField("eat_staple_breakfast")
    private Integer eatStapleBreakfast;

    /**
     * 如果早餐吃主食请描述EH9
     */
    @TableField("eat_staple_breakfast_detail")
    private String eatStapleBreakfastDetail;

    /**
     * 午餐是否吃主食EH9
     */
    @TableField("eat_staple_lunch")
    private Integer eatStapleLunch;

    /**
     * 如果午餐吃主食，请描述EH9
     */
    @TableField("eat_staple_lunch_detail")
    private String eatStapleLunchDetail;

    /**
     * 晚餐是否吃主食EH9
     */
    @TableField("eat_staple_dinner")
    private Integer eatStapleDinner;

    /**
     * 晚餐吃主食，请描述EH9
     */
    @TableField("eat_staple_dinner_detail")
    private String eatStapleDinnerDetail;

    /**
     * 吃粗粮食品的天数EH10
     */
    @TableField("eat_coarse_grain_food")
    private Integer eatCoarseGrainFood;

    /**
     * 每天新鲜蔬菜食用量EH11
     */
    @TableField("eat_Vegetables")
    private Integer eatVegetables;

    /**
     * 食用新鲜水果的习惯EH12  1-不吃， 2-1到3天， 3-4到6天， 4-每天
     */
    @TableField("eat_fruits")
    private Integer eatFruits;

    /**
     * 食用肉类食物量EH13 1-一掌以上, 2-一掌，3-半掌，4-半掌以下，5-不吃
     */
    @TableField("eat_meat")
    private Integer eatMeat;

    /**
     * 摄入肉类食物的主要种类EH14
     */
    @TableField("eat_meat_type")
    private String eatMeatType;

    /**
     * 摄入奶或奶制品的次数EH15
     */
    @TableField("eat_milk")
    private Integer eatMilk;

    /**
     * 摄入蛋类的次数EH16
     */
    @TableField("eat_eggs")
    private Integer eatEggs;

    /**
     * 摄入坚果的次数EH17
     */
    @TableField("eat_nut")
    private Integer eatNut;

    /**
     * 加餐习惯EH18
     */
    @TableField("eating_habits")
    private Integer eatingHabits;

    /**
     * 加餐时间EH18
     */
    @TableField("eating_habits_times")
    private Integer eatingHabitsTimes;

    /**
     * 加餐食物EH18
     */
    @TableField("eating_habits_food")
    private String eatingHabitsFood;

    /**
     * 是否偏油EH19
     */
    @TableField("is_oil")
    private Integer isOil;

    /**
     * 是否偏咸EH20
     */
    @TableField("is_salty")
    private Integer isSalty;

    /**
     * 烹调用油EH21
     */
    @TableField("cooking_oil")
    private String cookingOil;

    /**
     * 其它烹调用油描述EH21
     */
    @TableField("cooking_oil_others")
    private String cookingOilOthers;

    /**
     * 摄入零食的频率EH22
     */
    @TableField("eat_snacks")
    private Integer eatSnacks;

    /**
     * 饮用水种类EH23
     */
    @TableField("drinking_water_type")
    private Integer drinkingWaterType;

    /**
     * 饮用水习惯EH23
     */
    @TableField("drinking_water_habits")
    private Integer drinkingWaterHabits;

    /**
     * 饮用水量EH23
     */
    @TableField("drinking_water_amount")
    private Integer drinkingWaterAmount;

    /**
     * 饮用多少罐饮料EH24
     */
    @TableField("drinks_cans")
    private Integer drinksCans;

    /**
     * 营养保健品EH25
     */
    @TableField("health_products")
    private Integer healthProducts;

    /**
     * 营养保健品补充详情EH25
     */
    @TableField("health_products_detail")
    private String healthProductsDetail;

    /**
     * 滋补药材EH25
     */
    @TableField("tonic_herbs")
    private Integer tonicHerbs;

    /**
     * 滋补药材补充详情EH25
     */
    @TableField("tonic_herbs_detail")
    private String tonicHerbsDetail;

    /**
     * 茶饮EH25
     */
    @TableField("tea_drinks")
    private Integer teaDrinks;

    /**
     * 茶饮补充情况EH25
     */
    @TableField("tea_drinks_detail")
    private String teaDrinksDetail;

    /**
     * 吃早餐EH26
     */
    @TableField("eat_breakfast")
    private String eatBreakfast;

    /**
     * 吃午餐EH26
     */
    @TableField("eat_lunch")
    private String eatLunch;

    /**
     * 吃晚餐EH26
     */
    @TableField("eat_dinner")
    private String eatDinner;

    /**
     * 加餐EH26
     */
    @TableField("eat_extra_meal")
    private String eatExtraMeal;

    /**
     * 饮食习惯评分EH
     */
    @TableField("eating_habits_score")
    private Integer eatingHabitsScore;

    /**
     * 饮食习惯总结EH
     */
    @TableField("eating_habits_comment")
    private String eatingHabitsComment;

    /**
     * 多久喝一次酒DR2
     */
    @TableField("drinking_times")
    private Integer drinkingTimes;

    /**
     * 啤酒饮量DR3
     */
    @TableField("drinking_beer")
    private Integer drinkingBeer;

    /**
     * 白酒饮量DR4
     */
    @TableField("drinking_baijiu")
    private Integer drinkingBaijiu;

    /**
     * 黄酒饮量DR5
     */
    @TableField("drinking_yellow_wine")
    private Integer drinkingYellowWine;

    /**
     * 葡萄酒饮量DR6
     */
    @TableField("drinking_wine")
    private Integer drinkingWine;

    /**
     * 饮酒情况评分DR
     */
    @TableField("drinking_habits_score")
    private Integer drinkingHabitsScore;

    /**
     * 饮酒情况小结DR
     */
    @TableField("drinking_habits_comment")
    private String drinkingHabitsComment;

    /**
     * 起床后多久吸烟SM4
     */
    @TableField("smoking_after_getting_up")
    private Integer smokingAfterGettingUp;

    /**
     * 是否很难控制吸烟需求SM5
     */
    @TableField("is_control_smoking")
    private Integer isControlSmoking;

    /**
     * 最不愿意放弃哪支烟SM6
     */
    @TableField("which_cigarette_give_up")
    private Integer whichCigaretteGiveUp;

    /**
     * 醒来后第一个小时是否比其它时间段吸烟多SM7
     */
    @TableField("is_smoking_more_in_first")
    private Integer isSmokingMoreInFirst;

    /**
     * 卧病在床是否吸烟SM8
     */
    @TableField("is_smoking_in_bed")
    private Integer isSmokingInBed;

    /**
     * 吸烟情况评分SM
     */
    @TableField("smoking_habits_score")
    private Integer smokingHabitsScore;

    /**
     * 吸烟情况总结SM
     */
    @TableField("smoking_habits_comment")
    private String smokingHabitsComment;

    /**
     * 起床时间SL
     */
    @TableField("wake_up")
    private Integer wakeUp;

    /**
     * 具体起床时间SL
     */
    @TableField("wake_up_times")
    private Integer wakeUpTimes;

    /**
     * 睡觉时间SL
     */
    @TableField("sleep")
    private Integer sleep;

    /**
     * 具体睡觉时间SL
     */
    @TableField("sleep_times")
    private Integer sleepTimes;

    /**
     * 午休时间SL
     */
    @TableField("lunch_break")
    private Integer lunchBreak;

    /**
     * 具体午休时间SL
     */
    @TableField("lunch_break_times")
    private Integer lunchBreakTimes;

    /**
     * 睡眠质量原因SL
     */
    @TableField("sleep_quality_reason")
    private String sleepQualityReason;

    /**
     * 睡眠质量原因详情补充SL
     */
    @TableField("sleep_quality_reason_detail")
    private String sleepQualityReasonDetail;

    /**
     * 睡眠环境SL
     */
    @TableField("sleep_environment")
    private Integer sleepEnvironment;

    /**
     * 睡眠环境原因SL
     */
    @TableField("sleep_environment_reason")
    private String sleepEnvironmentReason;

    /**
     * 睡眠环境原因详情补充SL
     */
    @TableField("sleep_environment_reason_detail")
    private String sleepEnvironmentReasonDetail;

    /**
     * 睡眠质量评分SL
     */
    @TableField("sleep_habits_score")
    private Integer sleepHabitsScore;

    /**
     * 睡眠质量小结SL
     */
    @TableField("sleep_habits_comment")
    private String sleepHabitsComment;

    /**
     * 运动情况评分EX
     */
    @TableField("exercise_habits_score")
    private Integer exerciseHabitsScore;

    /**
     * 运动情况小结EX
     */
    @TableField("exercise_habits_comment")
    private String exerciseHabitsComment;

    public DtrdEntRdArchiveLifeway init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    /**
     * 从饮食结构进行转换
     * @param dto
     * @return
     */
    public DtrdEntRdArchiveLifeway parseFromDto(LifewayEatingDTO dto){
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        likeEat = dto.getLikeEat();
        likeDrink = dto.getLikeDrink();
        likeSnacks = dto.getLikeSnacks();
        stillBreakfast = dto.getStillBreakfast();
        whichMore = dto.getWhichMore();
        eatSatisfied = dto.getEatSatisfied();
        likeMidnightfood = dto.getLikeMidnightfood();
        stapleFoodStructure = dto.getStapleFoodStructure();
        eatStapleBreakfast = dto.getEatStapleBreakfast();
        eatStapleBreakfastDetail = dto.getEatStapleBreakfastDetail();
        eatStapleLunch = dto.getEatStapleLunch();
        eatStapleLunchDetail = dto.getEatStapleLunchDetail();
        eatStapleDinner = dto.getEatStapleDinner();
        eatStapleDinnerDetail = dto.getEatStapleDinnerDetail();
        eatCoarseGrainFood = dto.getEatCoarseGrainFood();
        eatVegetables = dto.getEatVegetables();
        eatFruits = dto.getEatFruits();
        eatMeat = dto.getEatMeat();
        eatMeatType = dto.getEatMeatType();
        eatMilk = dto.getEatMilk();
        eatEggs = dto.getEatEggs();
        eatNut = dto.getEatNut();
        eatingHabits = dto.getEatingHabits();
        eatingHabitsTimes = dto.getEatingHabitsTimes();
        eatingHabitsFood = dto.getEatingHabitsFood();
        isOil = dto.getIsOil();
        isSalty = dto.getIsSalty();
        cookingOil = dto.getCookingOil();
        cookingOilOthers = dto.getCookingOilOthers();
        eatSnacks = dto.getEatSnacks();
        drinkingWaterType = dto.getDrinkingWaterType();
        drinkingWaterHabits = dto.getDrinkingWaterHabits();
        drinkingWaterAmount = dto.getDrinkingWaterAmount();
        drinksCans = dto.getDrinksCans();
        healthProducts = dto.getHealthProducts();
        healthProductsDetail = dto.getHealthProductsDetail();
        tonicHerbs = dto.getTonicHerbs();
        tonicHerbsDetail = dto.getTonicHerbsDetail();
        teaDrinks = dto.getTeaDrinks();
        teaDrinksDetail = dto.getTeaDrinksDetail();
        eatBreakfast = dto.getEatBreakfast();
        eatLunch = dto.getEatLunch();
        eatDinner = dto.getEatDinner();
        eatExtraMeal = dto.getEatExtraMeal();
        eatingHabitsScore = dto.getEatingHabitsScore();
        eatingHabitsComment = dto.getEatingHabitsComment();
        return this;
    }

    /**
     * 从饮酒情况进行转换
     * @param dto
     * @return
     */
    public DtrdEntRdArchiveLifeway parseFromDto(LifewayDrinkingDTO dto){
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        drinkingFrequency = dto.getDrinkingFrequency();
        drinkingTimes = dto.getDrinkingTimes();
        drinkingBeer = dto.getDrinkingBeer();
        drinkingBaijiu = dto.getDrinkingBaijiu();
        drinkingYellowWine = dto.getDrinkingYellowWine();
        drinkingWine = dto.getDrinkingWine();
        drinkingHabitsScore = dto.getDrinkingHabitsScore();
        drinkingHabitsComment = dto.getDrinkingHabitsComment();
        return this;
    }

    /**
     * 从吸烟情况进行转换
     * @param dto
     * @return
     */
    public DtrdEntRdArchiveLifeway parseFromDto(LifewaySmokingDTO dto){
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        smoking = dto.getSmoking();
        smokingYear = dto.getSmokingYear();
        smokingAmount = dto.getSmokingAmount();
        unSmokingYear = dto.getUnSmokingYear();
        smokingAfterGettingUp = dto.getSmokingAfterGettingUp();
        isControlSmoking = dto.getIsControlSmoking();
        whichCigaretteGiveUp = dto.getWhichCigaretteGiveUp();
        isSmokingMoreInFirst = dto.getIsSmokingMoreInFirst();
        isSmokingInBed = dto.getIsSmokingInBed();
        smokingHabitsScore = dto.getSmokingHabitsScore();
        smokingHabitsComment = dto.getSmokingHabitsComment();
        return this;
    }

    public DtrdEntRdArchiveLifeway parseFromDto(LifewaySleepDTO dto){
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        sleepQuality = dto.getSleepQuality();
        wakeUp = dto.getWakeUp();
        wakeUpTimes = dto.getWakeUpTimes();
        sleep = dto.getSleep();
        sleepTimes = dto.getSleepTimes();
        lunchBreak = dto.getLunchBreak();
        lunchBreakTimes = dto.getLunchBreakTimes();
        sleepQualityReason = dto.getSleepQualityReason();
        sleepQualityReasonDetail = dto.getSleepQualityReasonDetail();
        sleepEnvironment = dto.getSleepEnvironment();
        sleepEnvironmentReason = dto.getSleepEnvironmentReason();
        sleepEnvironmentReasonDetail = dto.getSleepEnvironmentReasonDetail();
        sleepHabitsScore = dto.getSleepHabitsScore();
        sleepHabitsComment = dto.getSleepHabitsComment();
        return this;
    }

    public DtrdEntRdArchiveLifeway parseFromDto(LifewayExerciseDTO dto){
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        lifewaySport = dto.getLifewaySport();
        exerciseTaboo = dto.getExerciseTaboo();
        exerciseMode = dto.getExerciseMode();
        exerciseModeOther = dto.getExerciseModeOther();
        exerciseFrequency = dto.getExerciseFrequency();
        exerciseDuration = dto.getExerciseDuration();
        exerciseDurationHour = dto.getExerciseDurationHour();
        exerciseOpporunity = dto.getExerciseOpporunity();
        exerciseHabitsScore = dto.getExerciseHabitsScore();
        exerciseHabitsComment = dto.getExerciseHabitsComment();
        return this;
    }
}
